import * as Koa from 'koa'
import * as Router from "koa-router"
import sunchart from "./sunchart";
import user from "./user";
import chapter from "./chapter";


let modules = [
   sunchart,user,chapter
]

function init(app:Koa,router:Router){
    app.use(router.routes());
    app.use(router.allowedMethods());
}

export function initRoute (app:Koa){
    modules.forEach((mod)=>{
        init(app,mod)
    })
}